package com.dk.academic.service.impl;

import com.dk.academic.mapper.ArticleMapper;
import com.dk.academic.model.Article;
import com.dk.academic.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleServiceImpl implements ArticleService {

    @Autowired
    private ArticleMapper articleMapper;

    @Override
    public void insertArticle(Article article) {
        System.out.println("执行");
        try {
            articleMapper.insert(article);
        }catch (Exception e){
            e.printStackTrace();
        }
    }

    @Override
    public List<Article> selectArticles() {
        return articleMapper.selectArticles();
    }
}
